package com.xxx.objct;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/16  15:18
 * @Copyright
 */
public class Student {
    private String name;
    private int age;

    public Student() {


    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public boolean equals(Object obj) {
        Student s2 = (Student) obj;
        if (this.name.equals(s2.name) && this.age == s2.age) {
            return true;
        } else {
            return false;
        }
    }

    public int hashCode() {
        return this.name.hashCode() + this.age;
    }

    public String toString() {

        return this.name+" , "+ this.age;
    }


}
